package edu.upenn.cis.cis550.hw3.client;

import java.util.ArrayList;

import com.google.gwt.core.client.GWT;
import com.google.gwt.user.client.rpc.RemoteService;
import com.google.gwt.user.client.rpc.RemoteServiceRelativePath;

import edu.upenn.cis.cis550.hw3.client.QueryTables;
import edu.upenn.cis.cis550.hw3.client.QueryTablesAsync;
//import edu.upenn.cis.cis550.hw3.shared.Relation;
import edu.upenn.cis.cis550.hw3.shared.Relation;

/**
 * This interface is used to make calls from the browser in JavaScript,
 * to the server's Java code in QueryTablesAsync
 * 
 * @author zives
 *
 */
@RemoteServiceRelativePath("QueryTables")
public interface QueryTables extends RemoteService {
	/**
	 * Utility class for simplifying access to the instance of async service.
	 */
	public static class Util {
		private static QueryTablesAsync instance;
		public static QueryTablesAsync getInstance(){
			if (instance == null) {
				instance = GWT.create(QueryTables.class);
			}
			return instance;
		}
	}
	
	public Relation getTopScoringPhotos(String userid) throws IllegalArgumentException;
	
	public Boolean validatePassword(String username, String pass) throws IllegalArgumentException;
	
	public Relation getRecentUpdates(String userid) throws IllegalArgumentException;
	
	public Relation getPhotoTags(String photoid) throws IllegalArgumentException;
	
	public Relation getSearchedPhotos(String keywords, String userid);
	
	public Relation getFriends(int userid);
	
	public Relation getProfessors();
	
	public String getFriendsVisualizerXML(int userid);
	
	public Relation getUserInfo(String userid);
	
	public Relation getStudentInfo(String userid);
	
	public Relation getProfessorInfo(String userid);
	
	public Relation getCirclesInfo(String userid) throws IllegalArgumentException;
	
	public ArrayList<String> getAllTags();
	
	public String addFriend(int userid, int friendid, String circlename);
}
